﻿using System.Collections.Generic;
using System.Linq;
using System;
using System.Runtime.InteropServices;

namespace MyUtils.PInvoke.Structs
{
	[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
	struct SHFILEINFO
	{
		public static SHFILEINFO New()
		{
			return new SHFILEINFO
			{
				szDisplayName = new string('\0', 260),
				szTypeName = new string('\0', 80),
			};
		}

		public IntPtr hIcon;
		public IntPtr iIcon;
		public uint dwAttributes;
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
		public string szDisplayName;
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
		public string szTypeName;
	}
}